<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
	<th:block th:include="include :: header('推送记录信息列表')" />
</head>

<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								<label>推送标题：</label>
								<input type="text" name="title" th:value="${record!=null?record.title:''}"/>
							</li>
							<li>
								<label>仪表板名称：</label>
								<input type="text" name="resourceName" />
							</li>
							<li>
								<label>接收人工号：</label>
								<input type="text" name="loginIdList" />
							</li>
							<li>
								<label>推送状态：</label>
								<select name="status" th:with="type=${@dict.getType('de_to_oa_record_status')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>

			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="detooa:deToOaRecord:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="detooa:deToOaRecord:export">
					<i class="fa fa-download"></i> 导出
				</a>
				<a class="btn btn-danger" onclick="closeItem()">
					<i class="fa fa-reply-all"></i> 关闭
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<script th:inline="javascript">
		var editFlag = [[${@permission.hasPermi('detooa:deToOaRecord:edit')}]];
		var removeFlag = [[${@permission.hasPermi('detooa:deToOaRecord:remove')}]];
		var detailFlag = [[${@permission.hasPermi('detooa:deToOaRecord:detail')}]];
		var statusDatas = [[${@dict.getType('de_to_oa_record_status')}]];
		var prefix = ctx + "detooa/deToOaRecord";

		$(function () {
			var options = {
				url: prefix + "/list",
				detailUrl: prefix + "/detail/{id}",
				//removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
				modalName: "推送记录信息",
				sortName: "createTime",
		        sortOrder: "desc",
				columns: [{
					checkbox: true
				},
				{
					field: 'recordId',
					title: '记录ID',
					visible: false
				},
				{
					field: 'title',
					title: '推送标题'
				},
				{
					field: 'context',
					title: '推送内容',
					visible: false
				},
				{
					field: 'resourceId',
					title: '仪表板ID',
					visible: false
				},
				{
					field: 'resourceName',
					title: '仪表板名称'
				},
				{
					field: 'loginIdList',
					title: '接收人工号'
				},
				{
					field: 'status',
					title: '推送状态',
					formatter: function (value, row, index) {
						return $.table.selectDictLabel(statusDatas, value);
					}
				},
				{
		            field: 'createTime',
		            title: '创建时间',
		            sortable: true
		        },
				{
					field: 'remark',
					title: '备注',
					visible: false
				},
				{
					title: '操作',
					align: 'center',
					formatter: function (value, row, index) {
						var actions = [];
						//actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.recordId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
						//actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.recordId + '\')"><i class="fa fa-remove"></i>删除</a>');
						actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.recordId + '\')"><i class="fa fa-search"></i>详细</a>');
						return actions.join('');
					}
				}]
			};
			$.table.init(options);
		});
	</script>
</body>

</html>